package com.c.ctgproject.ui.production.material

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.c.ctgproject.base.BaseViewModel
import com.c.ctgproject.http.ApiMethods
import com.c.ctgproject.utils.MyLog
import com.c.ctgproject.utils.awaitSync
import com.c.ctgproject.utils.launch
import com.c.ctgproject.utils.userToken

class MaterialWeightViewModel : BaseViewModel() {
    private val mResult = MutableLiveData<String>()
    val result: LiveData<String> get() = mResult
    fun getMaterialList(page: Int, size: Int,search: String) {
        MyLog.d("上传内容:页面$page 大小$size 搜索内容$search")
        launch {
            mResult.value = ApiMethods.getApiService().getMaterialList(userToken, page, size, search).awaitSync()
        }
    }
}